package com.shexianyu.simple;

import java.util.HashMap;
import java.util.Map;

/**
 * 1446. 连续字符
 */
public class MaxPower {
    public int maxPower(String s) {
        int count = 1;
        int max = 1;
        for (int i = 0; i < s.length() - 1; i++) {
            if (s.charAt(i) == s.charAt(i + 1)) {
                count++;
                max = Math.max(max, count);
            } else {
                count = 1;
            }
        }
        return max;
    }
}
